// ==UserScript==
// @name           Rogers Yahoo Auto Login
// @namespace      http://mywebsite.com/myscripts
// @description    Make sure you automatically login to Rogers Yahoo Mail
// @include        http://*.rogers.yahoo.com*
// ==/UserScript==
/*
<form name=ymail_login_fm action="https://login.yahoo.com/config/login_verify2" autocomplete="off" method=post>
<input type=hidden name=".src" value="my">
<input type=hidden name=".done" value="http://lite.rogers.yahoo.com/index.html">
<input type=hidden name=".tries" value=1>
<small>To see your email, please verify your Yahoo! password. To regularly see emails without re-entering your password, click Edit and change this setting.<br>
<input type=password name=passwd size=10>
<input type=submit value="Submit"></small></form>
*/
var forms = document.getElementsByTagName( 'form' );
for( var i = 0; i < forms.length; i++ )
{
	if( forms[i].getAttribute('name') == "ymail_login_fm" &&
	    forms[i].getAttribute('action') == "https://login.yahoo.com/config/login_verify2" &&
	    forms[i].getAttribute('autocomplete') == "off" &&
	    forms[i].getAttribute('method') == "post")
	{
		var inputButton = forms[i].getElementsByTagName('INPUT');
		for( var j = 0; j < inputButton.length; j++ )
		{
		    if( inputButton[j].getAttribute('value') == "Submit" &&
	    	    	inputButton[j].getAttribute('type') == "submit" )
		    {
		    	inputButton[j].click();
		    }
		}
	}	
}
